//
//  XMRecentPhotosListCell.m
//  XunMi
//
//  Created by MacBook on 2024/3/22.
//  Copyright © 2024 TieZhu. All rights reserved.
//

#import "XMRecentPhotosListCell.h"
#import "XMRecentPhotosModel.h"

@implementation XMRecentPhotosListCell

- (void)awakeFromNib {
    [super awakeFromNib];
    kCornerRadius(_imgV, 10, 0, UIColor.clearColor);
    
    UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPressAction)];
    [self.imgV addGestureRecognizer:longPress];
}

- (void)setModel:(XMRecentPhotosModel *)model {
    _model = model;
    _stateImgV.hidden = model.status.intValue == 0 ? NO : YES;
    [self.imgV sd_setImageWithURL:kStringToUrl(model.image.file_url) placeholderImage:kDefaultCoverImg];
}

- (void)longPressAction {
    if (self.longPressBlock) {
        self.longPressBlock(self, self.model);
    }
}

@end
